#pragma once
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define PIPE_FILE "./myfifo"
#define MODE 0664

class CrePipeFile
{
public:
    CrePipeFile()
    {
        if(mkfifo(PIPE_FILE,MODE) == -1)
        {
            perror("mkfifo");
            exit(errno);
        }
    }
    ~CrePipeFile()
    {
        if(unlink(PIPE_FILE) == -1)
        {
            perror("unlink");
            exit(errno);
        }
    }
};